Skip to main content

do

Type

command

Summary

Executes a list of statements.

Syntax

do <statementList> [in caller]

Description

Use the do command to execute statements in a container, or to execute a statement that consists partly of a literal string and partly of a container or the return value from a function.

Using the do command is slower than directly executing the commands, because each statement must be compiled every time the do command is executed.

When the do statementList in caller form of the do command is used, the statementList is evaluated in the context of the handler where the do command appears.

To see how to create a numbered set of variables see the dictionary entry for the local command.

You can use the do as alternateLanguage variant of the do command to evaluate a statementList written in a non-LiveCode programming language.

Parameters

NameTypeDescription

statementList

A LiveCode statement, a container with one or more statements, or a string that evaluates to a statement.

Examples

do "go next card"
do "put" && tNewValue && "into tNumberOfRecords"
-- If tNewValue is 3, this would become "put 3 into tNumberOfRecords"
do "select" && line 3 of field "Objects"

command: debugDo, breakpoint, local, call, do as alternateLanguage

function: result

glossary: handler, execute, statement, compile, command

keyword: message box

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

web

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?